Integrand size = 31, antiderivative size = 323 \[ \int \cos ^2(c+d x) \cot ^2(c+d x) \sqrt {a+b \sin (c+d x)} \, dx=\frac {\left (4 a^2+15 b^2\right ) \cos (c+d x) \sqrt {a+b \sin (c+d x)}}{15 a b d}-\frac {2 \cos (c+d x) (a+b \sin (c+d x))^{3/2}}{5 b d}-\frac {\cot (c+d x) (a+b \sin (c+d x))^{3/2}}{a d}-\frac {\left (4 a^2+57 b^2\right ) E\left (\frac {1}{2} \left (c-\frac {\pi }{2}+d x\right )|\frac {2 b}{a+b}\right ) \sqrt {a+b \sin (c+d x)}}{15 b^2 d \sqrt {\frac {a+b \sin (c+d x)}{a+b}}}+\frac {a \left (4 a^2+11 b^2\right ) \operatorname {EllipticF}\left (\frac {1}{2} \left (c-\frac {\pi }{2}+d x\right ),\frac {2 b}{a+b}\right ) \sqrt {\frac {a+b \sin (c+d x)}{a+b}}}{15 b^2 d \sqrt {a+b \sin (c+d x)}}+\frac {b \operatorname {EllipticPi}\left (2,\frac {1}{2} \left (c-\frac {\pi }{2}+d x\right ),\frac {2 b}{a+b}\right ) \sqrt {\frac {a+b \sin (c+d x)}{a+b}}}{d \sqrt {a+b \sin (c+d x)}} \]
[Out]
Time = 0.63 (sec) , antiderivative size = 323, normalized size of antiderivative = 1.00, number of steps used = 10, number of rules used = 10, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.323, Rules used = {2973, 3128, 3138, 2734, 2732, 3081, 2742, 2740, 2886, 2884} \[ \int \cos ^2(c+d x) \cot ^2(c+d x) \sqrt {a+b \sin (c+d x)} \, dx=\frac {\left (4 a^2+15 b^2\right ) \cos (c+d x) \sqrt {a+b \sin (c+d x)}}{15 a b d}+\frac {a \left (4 a^2+11 b^2\right ) \sqrt {\frac {a+b \sin (c+d x)}{a+b}} \operatorname {EllipticF}\left (\frac {1}{2} \left (c+d x-\frac {\pi }{2}\right ),\frac {2 b}{a+b}\right )}{15 b^2 d \sqrt {a+b \sin (c+d x)}}-\frac {\left (4 a^2+57 b^2\right ) \sqrt {a+b \sin (c+d x)} E\left (\frac {1}{2} \left (c+d x-\frac {\pi }{2}\right )|\frac {2 b}{a+b}\right )}{15 b^2 d \sqrt {\frac {a+b \sin (c+d x)}{a+b}}}-\frac {2 \cos (c+d x) (a+b \sin (c+d x))^{3/2}}{5 b d}-\frac {\cot (c+d x) (a+b \sin (c+d x))^{3/2}}{a d}+\frac {b \sqrt {\frac {a+b \sin (c+d x)}{a+b}} \operatorname {EllipticPi}\left (2,\frac {1}{2} \left (c+d x-\frac {\pi }{2}\right ),\frac {2 b}{a+b}\right )}{d \sqrt {a+b \sin (c+d x)}} \]
[In]
[Out]
Rule 2732
Rule 2734
Rule 2740
Rule 2742
Rule 2884
Rule 2886
Rule 2973
Rule 3081
Rule 3128
Rule 3138
Rubi steps \begin{align*} \text {integral}& = -\frac {2 \cos (c+d x) (a+b \sin (c+d x))^{3/2}}{5 b d}-\frac {\cot (c+d x) (a+b \sin (c+d x))^{3/2}}{a d}-\frac {2 \int \csc (c+d x) \sqrt {a+b \sin (c+d x)} \left (-\frac {5 b^2}{4}+\frac {7}{2} a b \sin (c+d x)+\frac {1}{4} \left (4 a^2+15 b^2\right ) \sin ^2(c+d x)\right ) \, dx}{5 a b} \\ & = \frac {\left (4 a^2+15 b^2\right ) \cos (c+d x) \sqrt {a+b \sin (c+d x)}}{15 a b d}-\frac {2 \cos (c+d x) (a+b \sin (c+d x))^{3/2}}{5 b d}-\frac {\cot (c+d x) (a+b \sin (c+d x))^{3/2}}{a d}-\frac {4 \int \frac {\csc (c+d x) \left (-\frac {15 a b^2}{8}+\frac {23}{4} a^2 b \sin (c+d x)+\frac {1}{8} a \left (4 a^2+57 b^2\right ) \sin ^2(c+d x)\right )}{\sqrt {a+b \sin (c+d x)}} \, dx}{15 a b} \\ & = \frac {\left (4 a^2+15 b^2\right ) \cos (c+d x) \sqrt {a+b \sin (c+d x)}}{15 a b d}-\frac {2 \cos (c+d x) (a+b \sin (c+d x))^{3/2}}{5 b d}-\frac {\cot (c+d x) (a+b \sin (c+d x))^{3/2}}{a d}-\frac {1}{30} \left (57+\frac {4 a^2}{b^2}\right ) \int \sqrt {a+b \sin (c+d x)} \, dx+\frac {4 \int \frac {\csc (c+d x) \left (\frac {15 a b^3}{8}+\frac {1}{8} a^2 \left (4 a^2+11 b^2\right ) \sin (c+d x)\right )}{\sqrt {a+b \sin (c+d x)}} \, dx}{15 a b^2} \\ & = \frac {\left (4 a^2+15 b^2\right ) \cos (c+d x) \sqrt {a+b \sin (c+d x)}}{15 a b d}-\frac {2 \cos (c+d x) (a+b \sin (c+d x))^{3/2}}{5 b d}-\frac {\cot (c+d x) (a+b \sin (c+d x))^{3/2}}{a d}+\frac {1}{30} \left (a \left (11+\frac {4 a^2}{b^2}\right )\right ) \int \frac {1}{\sqrt {a+b \sin (c+d x)}} \, dx+\frac {1}{2} b \int \frac {\csc (c+d x)}{\sqrt {a+b \sin (c+d x)}} \, dx-\frac {\left (\left (57+\frac {4 a^2}{b^2}\right ) \sqrt {a+b \sin (c+d x)}\right ) \int \sqrt {\frac {a}{a+b}+\frac {b \sin (c+d x)}{a+b}} \, dx}{30 \sqrt {\frac {a+b \sin (c+d x)}{a+b}}} \\ & = \frac {\left (4 a^2+15 b^2\right ) \cos (c+d x) \sqrt {a+b \sin (c+d x)}}{15 a b d}-\frac {2 \cos (c+d x) (a+b \sin (c+d x))^{3/2}}{5 b d}-\frac {\cot (c+d x) (a+b \sin (c+d x))^{3/2}}{a d}-\frac {\left (57+\frac {4 a^2}{b^2}\right ) E\left (\frac {1}{2} \left (c-\frac {\pi }{2}+d x\right )|\frac {2 b}{a+b}\right ) \sqrt {a+b \sin (c+d x)}}{15 d \sqrt {\frac {a+b \sin (c+d x)}{a+b}}}+\frac {\left (a \left (11+\frac {4 a^2}{b^2}\right ) \sqrt {\frac {a+b \sin (c+d x)}{a+b}}\right ) \int \frac {1}{\sqrt {\frac {a}{a+b}+\frac {b \sin (c+d x)}{a+b}}} \, dx}{30 \sqrt {a+b \sin (c+d x)}}+\frac {\left (b \sqrt {\frac {a+b \sin (c+d x)}{a+b}}\right ) \int \frac {\csc (c+d x)}{\sqrt {\frac {a}{a+b}+\frac {b \sin (c+d x)}{a+b}}} \, dx}{2 \sqrt {a+b \sin (c+d x)}} \\ & = \frac {\left (4 a^2+15 b^2\right ) \cos (c+d x) \sqrt {a+b \sin (c+d x)}}{15 a b d}-\frac {2 \cos (c+d x) (a+b \sin (c+d x))^{3/2}}{5 b d}-\frac {\cot (c+d x) (a+b \sin (c+d x))^{3/2}}{a d}-\frac {\left (57+\frac {4 a^2}{b^2}\right ) E\left (\frac {1}{2} \left (c-\frac {\pi }{2}+d x\right )|\frac {2 b}{a+b}\right ) \sqrt {a+b \sin (c+d x)}}{15 d \sqrt {\frac {a+b \sin (c+d x)}{a+b}}}+\frac {a \left (11+\frac {4 a^2}{b^2}\right ) \operatorname {EllipticF}\left (\frac {1}{2} \left (c-\frac {\pi }{2}+d x\right ),\frac {2 b}{a+b}\right ) \sqrt {\frac {a+b \sin (c+d x)}{a+b}}}{15 d \sqrt {a+b \sin (c+d x)}}+\frac {b \operatorname {EllipticPi}\left (2,\frac {1}{2} \left (c-\frac {\pi }{2}+d x\right ),\frac {2 b}{a+b}\right ) \sqrt {\frac {a+b \sin (c+d x)}{a+b}}}{d \sqrt {a+b \sin (c+d x)}} \\ \end{align*}
Result contains complex when optimal does not.
Time = 2.67 (sec) , antiderivative size = 422, normalized size of antiderivative = 1.31 \[ \int \cos ^2(c+d x) \cot ^2(c+d x) \sqrt {a+b \sin (c+d x)} \, dx=\frac {\frac {2 i \left (4 a^2+57 b^2\right ) \left (-2 a (a-b) E\left (i \text {arcsinh}\left (\sqrt {-\frac {1}{a+b}} \sqrt {a+b \sin (c+d x)}\right )|\frac {a+b}{a-b}\right )+b \left (-2 a \operatorname {EllipticF}\left (i \text {arcsinh}\left (\sqrt {-\frac {1}{a+b}} \sqrt {a+b \sin (c+d x)}\right ),\frac {a+b}{a-b}\right )+b \operatorname {EllipticPi}\left (\frac {a+b}{a},i \text {arcsinh}\left (\sqrt {-\frac {1}{a+b}} \sqrt {a+b \sin (c+d x)}\right ),\frac {a+b}{a-b}\right )\right )\right ) \sec (c+d x) \sqrt {-\frac {b (-1+\sin (c+d x))}{a+b}} \sqrt {-\frac {b (1+\sin (c+d x))}{a-b}}}{a b^3 \sqrt {-\frac {1}{a+b}}}+\frac {184 a \operatorname {EllipticF}\left (\frac {1}{4} (-2 c+\pi -2 d x),\frac {2 b}{a+b}\right ) \sqrt {\frac {a+b \sin (c+d x)}{a+b}}}{\sqrt {a+b \sin (c+d x)}}+\frac {2 \left (4 a^2+27 b^2\right ) \operatorname {EllipticPi}\left (2,\frac {1}{4} (-2 c+\pi -2 d x),\frac {2 b}{a+b}\right ) \sqrt {\frac {a+b \sin (c+d x)}{a+b}}}{b \sqrt {a+b \sin (c+d x)}}-\frac {4 \sqrt {a+b \sin (c+d x)} (2 a \cos (c+d x)+3 b (5 \cot (c+d x)+\sin (2 (c+d x))))}{b}}{60 d} \]
[In]
[Out]
Time = 1.40 (sec) , antiderivative size = 657, normalized size of antiderivative = 2.03
method | result | size |
default | \(-\frac {-6 a \,b^{4} \left (\cos ^{4}\left (d x +c \right )\right ) \sin \left (d x +c \right )-8 a^{2} b^{3} \left (\cos ^{4}\left (d x +c \right )\right )+\left (2 a^{3} b^{2}+21 a \,b^{4}\right ) \left (\cos ^{2}\left (d x +c \right )\right ) \sin \left (d x +c \right )+23 a^{2} b^{3} \left (\cos ^{2}\left (d x +c \right )\right )-\sqrt {\frac {b \sin \left (d x +c \right )}{a -b}+\frac {a}{a -b}}\, \sqrt {-\frac {b \sin \left (d x +c \right )}{a -b}-\frac {b}{a -b}}\, \sqrt {-\frac {b \sin \left (d x +c \right )}{a +b}+\frac {b}{a +b}}\, \left (4 E\left (\sqrt {\frac {b \sin \left (d x +c \right )}{a -b}+\frac {a}{a -b}}, \sqrt {\frac {a -b}{a +b}}\right ) a^{5}+53 E\left (\sqrt {\frac {b \sin \left (d x +c \right )}{a -b}+\frac {a}{a -b}}, \sqrt {\frac {a -b}{a +b}}\right ) a^{3} b^{2}-57 E\left (\sqrt {\frac {b \sin \left (d x +c \right )}{a -b}+\frac {a}{a -b}}, \sqrt {\frac {a -b}{a +b}}\right ) a \,b^{4}-4 F\left (\sqrt {\frac {b \sin \left (d x +c \right )}{a -b}+\frac {a}{a -b}}, \sqrt {\frac {a -b}{a +b}}\right ) a^{4} b -42 F\left (\sqrt {\frac {b \sin \left (d x +c \right )}{a -b}+\frac {a}{a -b}}, \sqrt {\frac {a -b}{a +b}}\right ) a^{3} b^{2}-11 F\left (\sqrt {\frac {b \sin \left (d x +c \right )}{a -b}+\frac {a}{a -b}}, \sqrt {\frac {a -b}{a +b}}\right ) a^{2} b^{3}+57 F\left (\sqrt {\frac {b \sin \left (d x +c \right )}{a -b}+\frac {a}{a -b}}, \sqrt {\frac {a -b}{a +b}}\right ) a \,b^{4}-15 \Pi \left (\sqrt {\frac {b \sin \left (d x +c \right )}{a -b}+\frac {a}{a -b}}, \frac {a -b}{a}, \sqrt {\frac {a -b}{a +b}}\right ) a \,b^{4}+15 \Pi \left (\sqrt {\frac {b \sin \left (d x +c \right )}{a -b}+\frac {a}{a -b}}, \frac {a -b}{a}, \sqrt {\frac {a -b}{a +b}}\right ) b^{5}\right ) \sin \left (d x +c \right )}{15 a \,b^{3} \sin \left (d x +c \right ) \cos \left (d x +c \right ) \sqrt {a +b \sin \left (d x +c \right )}\, d}\) | \(657\) |
[In]
[Out]
Timed out. \[ \int \cos ^2(c+d x) \cot ^2(c+d x) \sqrt {a+b \sin (c+d x)} \, dx=\text {Timed out} \]
[In]
[Out]
\[ \int \cos ^2(c+d x) \cot ^2(c+d x) \sqrt {a+b \sin (c+d x)} \, dx=\int \sqrt {a + b \sin {\left (c + d x \right )}} \cos ^{2}{\left (c + d x \right )} \cot ^{2}{\left (c + d x \right )}\, dx \]
[In]
[Out]
\[ \int \cos ^2(c+d x) \cot ^2(c+d x) \sqrt {a+b \sin (c+d x)} \, dx=\int { \sqrt {b \sin \left (d x + c\right ) + a} \cos \left (d x + c\right )^{2} \cot \left (d x + c\right )^{2} \,d x } \]
[In]
[Out]
Timed out. \[ \int \cos ^2(c+d x) \cot ^2(c+d x) \sqrt {a+b \sin (c+d x)} \, dx=\text {Timed out} \]
[In]
[Out]
Timed out. \[ \int \cos ^2(c+d x) \cot ^2(c+d x) \sqrt {a+b \sin (c+d x)} \, dx=\int {\cos \left (c+d\,x\right )}^2\,{\mathrm {cot}\left (c+d\,x\right )}^2\,\sqrt {a+b\,\sin \left (c+d\,x\right )} \,d x \]
[In]
[Out]